﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.IO;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            clsMenu clsMN = new clsMenu();
            lblMenu.Text = clsMN.taoMenu();
            lblAnhHoatDong.Text = layAnhHoatDong();
            lblQuangCao.Text = layAnhQuangcao();
        }
    }
    protected string layAnhQuangcao()
    {
        string fileList = "";
        string path = Server.MapPath("Quangcao");
        DirectoryInfo dir = new DirectoryInfo(path);

        FileInfo[] files = dir.GetFiles();
        foreach (FileInfo file in files)
        { 
            fileList = fileList + "<img src='Quangcao/" + file.Name + "'>";
        }
        return fileList;
    }
    protected string layAnhHoatDong()
    {
        string fileList = "";
        string path = Server.MapPath("Hoatdong");
        DirectoryInfo dir = new DirectoryInfo(path);

        FileInfo[] files = dir.GetFiles();
        foreach (FileInfo file in files)
        {
            fileList = fileList + "<img src='Hoatdong/" + file.Name + "'>";
        }
        return fileList;
    }
}
